package com.fc.v2.model.auto;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import cn.hutool.core.util.StrUtil;

/**
 * 自动生成测试 MybatisTestExample
 * @author fuce_自动生成
 * @date 2023-10-12 09:56:08
 */
public class MybatisTestExample {

    protected String orderByClause;

    protected boolean distinct;

    protected List<Criteria> oredCriteria;

    public MybatisTestExample() {
        oredCriteria = new ArrayList<Criteria>();
    }

    public void setOrderByClause(String orderByClause) {
        this.orderByClause = orderByClause;
    }

    public String getOrderByClause() {
        return orderByClause;
    }

    public void setDistinct(boolean distinct) {
        this.distinct = distinct;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public List<Criteria> getOredCriteria() {
        return oredCriteria;
    }

    public void or(Criteria criteria) {
        oredCriteria.add(criteria);
    }

    public Criteria or() {
        Criteria criteria = createCriteriaInternal();
        oredCriteria.add(criteria);
        return criteria;
    }

    public Criteria createCriteria() {
        Criteria criteria = createCriteriaInternal();
        if (oredCriteria.size() == 0) {
            oredCriteria.add(criteria);
        }
        return criteria;
    }

    protected Criteria createCriteriaInternal() {
        Criteria criteria = new Criteria();
        return criteria;
    }

    public void clear() {
        oredCriteria.clear();
        orderByClause = null;
        distinct = false;
    }

    protected abstract static class GeneratedCriteria {
        protected List<Criterion> criteria;

        protected GeneratedCriteria() {
            super();
            criteria = new ArrayList<Criterion>();
        }

        public boolean isValid() {
            return criteria.size() > 0;
        }

        public List<Criterion> getAllCriteria() {
            return criteria;
        }

        public List<Criterion> getCriteria() {
            return criteria;
        }

        protected void addCriterion(String condition) {
            if (condition == null) {
                throw new RuntimeException("Value for condition cannot be null");
            }
            criteria.add(new Criterion(condition));
        }

        protected void addCriterion(String condition, Object value, String property) {
            if (value == null) {
                throw new RuntimeException("Value for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value));
        }

        protected void addCriterion(String condition, Object value1, Object value2, String property) {
            if (value1 == null || value2 == null) {
                throw new RuntimeException("Between values for " + property + " cannot be null");
            }
            criteria.add(new Criterion(condition, value1, value2));
        }
        
		
        public Criteria andIdIsNull() {
            addCriterion("id is null");
            return (Criteria) this;
        }

        public Criteria andIdIsNotNull() {
            addCriterion("id is not null");
            return (Criteria) this;
        }

        public Criteria andIdEqualTo(String value) {
            addCriterion("id =", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotEqualTo(String value) {
            addCriterion("id <>", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThan(String value) {
            addCriterion("id >", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdGreaterThanOrEqualTo(String value) {
            addCriterion("id >=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThan(String value) {
            addCriterion("id <", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLessThanOrEqualTo(String value) {
            addCriterion("id <=", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdLike(String value) {
            addCriterion("id like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotLike(String value) {
            addCriterion("id not like", value, "id");
            return (Criteria) this;
        }

        public Criteria andIdIn(List<String> values) {
            addCriterion("id in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotIn(List<String> values) {
            addCriterion("id not in", values, "id");
            return (Criteria) this;
        }

        public Criteria andIdBetween(String value1, String value2) {
            addCriterion("id between", value1, value2, "id");
            return (Criteria) this;
        }

        public Criteria andIdNotBetween(String value1, String value2) {
            addCriterion("id not between", value1, value2, "id");
            return (Criteria) this;
        }
        
		
        public Criteria andTitlexIsNull() {
            addCriterion("titlex is null");
            return (Criteria) this;
        }

        public Criteria andTitlexIsNotNull() {
            addCriterion("titlex is not null");
            return (Criteria) this;
        }

        public Criteria andTitlexEqualTo(String value) {
            addCriterion("titlex =", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexNotEqualTo(String value) {
            addCriterion("titlex <>", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexGreaterThan(String value) {
            addCriterion("titlex >", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexGreaterThanOrEqualTo(String value) {
            addCriterion("titlex >=", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexLessThan(String value) {
            addCriterion("titlex <", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexLessThanOrEqualTo(String value) {
            addCriterion("titlex <=", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexLike(String value) {
            addCriterion("titlex like", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexNotLike(String value) {
            addCriterion("titlex not like", value, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexIn(List<String> values) {
            addCriterion("titlex in", values, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexNotIn(List<String> values) {
            addCriterion("titlex not in", values, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexBetween(String value1, String value2) {
            addCriterion("titlex between", value1, value2, "titlex");
            return (Criteria) this;
        }

        public Criteria andTitlexNotBetween(String value1, String value2) {
            addCriterion("titlex not between", value1, value2, "titlex");
            return (Criteria) this;
        }
        
		
        public Criteria andIfabcIsNull() {
            addCriterion("ifabc is null");
            return (Criteria) this;
        }

        public Criteria andIfabcIsNotNull() {
            addCriterion("ifabc is not null");
            return (Criteria) this;
        }

        public Criteria andIfabcEqualTo(Integer value) {
            addCriterion("ifabc =", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcNotEqualTo(Integer value) {
            addCriterion("ifabc <>", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcGreaterThan(Integer value) {
            addCriterion("ifabc >", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcGreaterThanOrEqualTo(Integer value) {
            addCriterion("ifabc >=", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcLessThan(Integer value) {
            addCriterion("ifabc <", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcLessThanOrEqualTo(Integer value) {
            addCriterion("ifabc <=", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcLike(Integer value) {
            addCriterion("ifabc like", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcNotLike(Integer value) {
            addCriterion("ifabc not like", value, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcIn(List<Integer> values) {
            addCriterion("ifabc in", values, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcNotIn(List<Integer> values) {
            addCriterion("ifabc not in", values, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcBetween(Integer value1, Integer value2) {
            addCriterion("ifabc between", value1, value2, "ifabc");
            return (Criteria) this;
        }

        public Criteria andIfabcNotBetween(Integer value1, Integer value2) {
            addCriterion("ifabc not between", value1, value2, "ifabc");
            return (Criteria) this;
        }
        
		
        public Criteria andReatetimeIsNull() {
            addCriterion("reatetime is null");
            return (Criteria) this;
        }

        public Criteria andReatetimeIsNotNull() {
            addCriterion("reatetime is not null");
            return (Criteria) this;
        }

        public Criteria andReatetimeEqualTo(Date value) {
            addCriterion("reatetime =", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeNotEqualTo(Date value) {
            addCriterion("reatetime <>", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeGreaterThan(Date value) {
            addCriterion("reatetime >", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeGreaterThanOrEqualTo(Date value) {
            addCriterion("reatetime >=", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeLessThan(Date value) {
            addCriterion("reatetime <", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeLessThanOrEqualTo(Date value) {
            addCriterion("reatetime <=", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeLike(Date value) {
            addCriterion("reatetime like", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeNotLike(Date value) {
            addCriterion("reatetime not like", value, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeIn(List<Date> values) {
            addCriterion("reatetime in", values, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeNotIn(List<Date> values) {
            addCriterion("reatetime not in", values, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeBetween(Date value1, Date value2) {
            addCriterion("reatetime between", value1, value2, "reatetime");
            return (Criteria) this;
        }

        public Criteria andReatetimeNotBetween(Date value1, Date value2) {
            addCriterion("reatetime not between", value1, value2, "reatetime");
            return (Criteria) this;
        }
        
		
        public Criteria andAsdtimeIsNull() {
            addCriterion("asdtime is null");
            return (Criteria) this;
        }

        public Criteria andAsdtimeIsNotNull() {
            addCriterion("asdtime is not null");
            return (Criteria) this;
        }

        public Criteria andAsdtimeEqualTo(Date value) {
            addCriterion("asdtime =", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeNotEqualTo(Date value) {
            addCriterion("asdtime <>", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeGreaterThan(Date value) {
            addCriterion("asdtime >", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeGreaterThanOrEqualTo(Date value) {
            addCriterion("asdtime >=", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeLessThan(Date value) {
            addCriterion("asdtime <", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeLessThanOrEqualTo(Date value) {
            addCriterion("asdtime <=", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeLike(Date value) {
            addCriterion("asdtime like", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeNotLike(Date value) {
            addCriterion("asdtime not like", value, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeIn(List<Date> values) {
            addCriterion("asdtime in", values, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeNotIn(List<Date> values) {
            addCriterion("asdtime not in", values, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeBetween(Date value1, Date value2) {
            addCriterion("asdtime between", value1, value2, "asdtime");
            return (Criteria) this;
        }

        public Criteria andAsdtimeNotBetween(Date value1, Date value2) {
            addCriterion("asdtime not between", value1, value2, "asdtime");
            return (Criteria) this;
        }
        
		
        public Criteria andFsvIsNull() {
            addCriterion("fsv is null");
            return (Criteria) this;
        }

        public Criteria andFsvIsNotNull() {
            addCriterion("fsv is not null");
            return (Criteria) this;
        }

        public Criteria andFsvEqualTo(String value) {
            addCriterion("fsv =", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvNotEqualTo(String value) {
            addCriterion("fsv <>", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvGreaterThan(String value) {
            addCriterion("fsv >", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvGreaterThanOrEqualTo(String value) {
            addCriterion("fsv >=", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvLessThan(String value) {
            addCriterion("fsv <", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvLessThanOrEqualTo(String value) {
            addCriterion("fsv <=", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvLike(String value) {
            addCriterion("fsv like", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvNotLike(String value) {
            addCriterion("fsv not like", value, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvIn(List<String> values) {
            addCriterion("fsv in", values, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvNotIn(List<String> values) {
            addCriterion("fsv not in", values, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvBetween(String value1, String value2) {
            addCriterion("fsv between", value1, value2, "fsv");
            return (Criteria) this;
        }

        public Criteria andFsvNotBetween(String value1, String value2) {
            addCriterion("fsv not between", value1, value2, "fsv");
            return (Criteria) this;
        }
        
	
		 public Criteria andLikeQuery(MybatisTest record) {
		 	List<String> list= new ArrayList<String>();
		 	List<String> list2= new ArrayList<String>();
        	StringBuffer buffer=new StringBuffer();
			if(record.getId()!=null&&StrUtil.isNotEmpty(record.getId().toString())) {
    			 list.add("ifnull(id,'')");
    		}
			if(record.getTitlex()!=null&&StrUtil.isNotEmpty(record.getTitlex().toString())) {
    			 list.add("ifnull(titlex,'')");
    		}
			if(record.getIfabc()!=null&&StrUtil.isNotEmpty(record.getIfabc().toString())) {
    			 list.add("ifnull(ifabc,'')");
    		}
			if(record.getReatetime()!=null&&StrUtil.isNotEmpty(record.getReatetime().toString())) {
    			 list.add("ifnull(reatetime,'')");
    		}
			if(record.getAsdtime()!=null&&StrUtil.isNotEmpty(record.getAsdtime().toString())) {
    			 list.add("ifnull(asdtime,'')");
    		}
			if(record.getFsv()!=null&&StrUtil.isNotEmpty(record.getFsv().toString())) {
    			 list.add("ifnull(fsv,'')");
    		}
			if(record.getId()!=null&&StrUtil.isNotEmpty(record.getId().toString())) {
    			list2.add("'%"+record.getId()+"%'");
    		}
			if(record.getTitlex()!=null&&StrUtil.isNotEmpty(record.getTitlex().toString())) {
    			list2.add("'%"+record.getTitlex()+"%'");
    		}
			if(record.getIfabc()!=null&&StrUtil.isNotEmpty(record.getIfabc().toString())) {
    			list2.add("'%"+record.getIfabc()+"%'");
    		}
			if(record.getReatetime()!=null&&StrUtil.isNotEmpty(record.getReatetime().toString())) {
    			list2.add("'%"+record.getReatetime()+"%'");
    		}
			if(record.getAsdtime()!=null&&StrUtil.isNotEmpty(record.getAsdtime().toString())) {
    			list2.add("'%"+record.getAsdtime()+"%'");
    		}
			if(record.getFsv()!=null&&StrUtil.isNotEmpty(record.getFsv().toString())) {
    			list2.add("'%"+record.getFsv()+"%'");
    		}
        	buffer.append(" CONCAT(");
	        buffer.append(StrUtil.join(",",list));
        	buffer.append(")");
        	buffer.append(" like CONCAT(");
        	buffer.append(StrUtil.join(",",list2));
        	buffer.append(")");
        	if(!" CONCAT() like CONCAT()".equals(buffer.toString())) {
        		addCriterion(buffer.toString());
        	}
        	return (Criteria) this;
        }
        
        public Criteria andLikeQuery2(String searchText) {
		 	List<String> list= new ArrayList<String>();
        	StringBuffer buffer=new StringBuffer();
    		list.add("ifnull(id,'')");
    		list.add("ifnull(titlex,'')");
    		list.add("ifnull(ifabc,'')");
    		list.add("ifnull(reatetime,'')");
    		list.add("ifnull(asdtime,'')");
    		list.add("ifnull(fsv,'')");
        	buffer.append(" CONCAT(");
	        buffer.append(StrUtil.join(",",list));
        	buffer.append(")");
        	buffer.append("like '%");
        	buffer.append(searchText);
        	buffer.append("%'");
        	addCriterion(buffer.toString());
        	return (Criteria) this;
        }
        
}
	
    public static class Criteria extends GeneratedCriteria {
        protected Criteria() {
            super();
        }
    }

    public static class Criterion {
        private String condition;

        private Object value;

        private Object secondValue;

        private boolean noValue;

        private boolean singleValue;

        private boolean betweenValue;

        private boolean listValue;

        private String typeHandler;

        public String getCondition() {
            return condition;
        }

        public Object getValue() {
            return value;
        }

        public Object getSecondValue() {
            return secondValue;
        }

        public boolean isNoValue() {
            return noValue;
        }

        public boolean isSingleValue() {
            return singleValue;
        }

        public boolean isBetweenValue() {
            return betweenValue;
        }

        public boolean isListValue() {
            return listValue;
        }

        public String getTypeHandler() {
            return typeHandler;
        }

        protected Criterion(String condition) {
            super();
            this.condition = condition;
            this.typeHandler = null;
            this.noValue = true;
        }

        protected Criterion(String condition, Object value, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.typeHandler = typeHandler;
            if (value instanceof List<?>) {
                this.listValue = true;
            } else {
                this.singleValue = true;
            }
        }

        protected Criterion(String condition, Object value) {
            this(condition, value, null);
        }

        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
            super();
            this.condition = condition;
            this.value = value;
            this.secondValue = secondValue;
            this.typeHandler = typeHandler;
            this.betweenValue = true;
        }

        protected Criterion(String condition, Object value, Object secondValue) {
            this(condition, value, secondValue, null);
        }
    }
}